import { defineStore } from "pinia";

export const useCounterStore = defineStore("counter", {
  state: () => {
    return {
      count: 0,
      age: 18
    };
  },
  getters: {
    oddOrEven(state) {
      return (state.count & 1) === 1 ? "奇数" : "偶数";
    },
  },
  actions: {
    increment(num: number) {
      this.count += num;
    },
  },
});
